﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace DAL
{
    public class DeductMoney
    {
        public static int insert(int oiid,string type,string reason, int adminId)
        {
            return Convert.ToInt32(DbHelper.ExecuteScalar("p_DeductMoney_insert",oiid,type,reason,adminId));
        }
        public static void getDeductHistoryList(int companyId,out int totalCount,out double totalMoney)
        {
            totalCount = 0;
            totalMoney = 0;
            DataRow dr = DbHelper.ExecuteDataRow("p_deductMoney_historyList", companyId);
            if (dr!=null)
            {
                if (dr["totalCount"]!=DBNull.Value)
                {
                    totalCount = Convert.ToInt32(dr["totalCount"]);
                }
                if(dr["totalMoney"]!=DBNull.Value)
                {
                    totalMoney = Convert.ToDouble(dr["totalMoney"]);
                }
            }
        }
    }
}
